<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>班级管理 - 学生信息管理系统</title>
    <link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar">
        <div class="container">
            <a href="index.jsp" class="navbar-brand">学生信息管理系统</a>
            <ul class="navbar-menu">
                <li><a href="index.jsp">首页</a></li>
                <li><a href="student-management.jsp">学生管理</a></li>
                <li><a href="class-management.jsp">班级管理</a></li>
                <li><a href="score-management.jsp">成绩管理</a></li>
                <li><a href="#" onclick="alert('退出登录'); return false;">退出登录</a></li>
            </ul>
        </div>
    </nav>
    
    <div class="container">
        <h1>班级管理</h1>
        
        <!-- 显示消息提示 -->
        <% if (request.getAttribute("message") != null) { %>
            <div class="message success">
                <%= request.getAttribute("message") %>
            </div>
        <% } %>
        
        <% if (request.getAttribute("error") != null) { %>
            <div class="message error">
                <%= request.getAttribute("error") %>
            </div>
        <% } %>
        
        <!-- 操作栏 -->
        <div class="action-bar">
            <a href="class-form.jsp" class="btn btn-primary">添加班级</a>
            
            <!-- 搜索和筛选区域 -->
            <div class="search-filter">
                <input type="text" id="searchInput" placeholder="搜索班级名称或班主任" class="search-input">
                
                <select id="gradeFilter" class="filter-select">
                    <option value="">所有年级</option>
                    <option value="2020">2020级</option>
                    <option value="2021">2021级</option>
                    <option value="2022">2022级</option>
                    <option value="2023">2023级</option>
                </select>
                
                <select id="majorFilter" class="filter-select">
                    <option value="">所有专业</option>
                    <option value="computer">计算机科学与技术</option>
                    <option value="software">软件工程</option>
                    <option value="network">网络工程</option>
                    <option value="ai">人工智能</option>
                </select>
                
                <button id="searchBtn" class="btn btn-secondary">搜索</button>
            </div>
        </div>
        
        <!-- 班级列表表格 -->
        <div class="table-container">
            <table class="data-table">
                <thead>
                    <tr>
                        <th><input type="checkbox" id="selectAll"></th>
                        <th>班级ID</th>
                        <th>班级名称</th>
                        <th>年级</th>
                        <th>专业</th>
                        <th>班主任</th>
                        <th>学生数量</th>
                        <th>创建时间</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody id="classTableBody">
                    <!-- 模拟数据 -->
                    <tr>
                        <td><input type="checkbox" class="selectRow" data-id="1"></td>
                        <td>CS202301</td>
                        <td>计算机2023级1班</td>
                        <td>2023级</td>
                        <td>计算机科学与技术</td>
                        <td>王老师</td>
                        <td>35</td>
                        <td>2023-09-01</td>
                        <td>
                            <a href="class-form.jsp?id=CS202301" class="btn btn-small btn-info">编辑</a>
                            <a href="#" class="btn btn-small btn-danger delete-btn" data-id="CS202301">删除</a>
                            <a href="student-management.jsp?classId=CS202301" class="btn btn-small btn-secondary">查看学生</a>
                        </td>
                    </tr>
                    <tr>
                        <td><input type="checkbox" class="selectRow" data-id="2"></td>
                        <td>CS202302</td>
                        <td>计算机2023级2班</td>
                        <td>2023级</td>
                        <td>计算机科学与技术</td>
                        <td>李老师</td>
                        <td>32</td>
                        <td>2023-09-01</td>
                        <td>
                            <a href="class-form.jsp?id=CS202302" class="btn btn-small btn-info">编辑</a>
                            <a href="#" class="btn btn-small btn-danger delete-btn" data-id="CS202302">删除</a>
                            <a href="student-management.jsp?classId=CS202302" class="btn btn-small btn-secondary">查看学生</a>
                        </td>
                    </tr>
                    <tr>
                        <td><input type="checkbox" class="selectRow" data-id="3"></td>
                        <td>SE202301</td>
                        <td>软件工程2023级1班</td>
                        <td>2023级</td>
                        <td>软件工程</td>
                        <td>张老师</td>
                        <td>30</td>
                        <td>2023-09-01</td>
                        <td>
                            <a href="class-form.jsp?id=SE202301" class="btn btn-small btn-info">编辑</a>
                            <a href="#" class="btn btn-small btn-danger delete-btn" data-id="SE202301">删除</a>
                            <a href="student-management.jsp?classId=SE202301" class="btn btn-small btn-secondary">查看学生</a>
                        </td>
                    </tr>
                    <tr>
                        <td><input type="checkbox" class="selectRow" data-id="4"></td>
                        <td>NE202301</td>
                        <td>网络工程2023级1班</td>
                        <td>2023级</td>
                        <td>网络工程</td>
                        <td>刘老师</td>
                        <td>28</td>
                        <td>2023-09-01</td>
                        <td>
                            <a href="class-form.jsp?id=NE202301" class="btn btn-small btn-info">编辑</a>
                            <a href="#" class="btn btn-small btn-danger delete-btn" data-id="NE202301">删除</a>
                            <a href="student-management.jsp?classId=NE202301" class="btn btn-small btn-secondary">查看学生</a>
                        </td>
                    </tr>
                    <tr>
                        <td><input type="checkbox" class="selectRow" data-id="5"></td>
                        <td>AI202301</td>
                        <td>人工智能2023级1班</td>
                        <td>2023级</td>
                        <td>人工智能</td>
                        <td>陈老师</td>
                        <td>25</td>
                        <td>2023-09-01</td>
                        <td>
                            <a href="class-form.jsp?id=AI202301" class="btn btn-small btn-info">编辑</a>
                            <a href="#" class="btn btn-small btn-danger delete-btn" data-id="AI202301">删除</a>
                            <a href="student-management.jsp?classId=AI202301" class="btn btn-small btn-secondary">查看学生</a>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        
        <!-- 分页控件 -->
        <div class="pagination">
            <button class="pagination-btn" disabled>&laquo; 上一页</button>
            <button class="pagination-btn active">1</button>
            <button class="pagination-btn">2</button>
            <button class="pagination-btn">3</button>
            <button class="pagination-btn">下一页 &raquo;</button>
            <span class="pagination-info">共 12 条记录，每页 5 条</span>
        </div>
        
        <!-- 批量操作 -->
        <div class="batch-operations">
            <button id="batchDeleteBtn" class="btn btn-danger">批量删除</button>
        </div>
    </div>
    
    <script src="js/script.js"></script>

</body>
</html>